# 要求的Cmake最低版本
CMAKE_MINIMUM_REQUIRED( VERSION 2.8)

# 设置Cmake系统名字
set(CMAKE_SYSTEM_NAME Window)


# 设置可见
#set(CMAKE_VERBOSE_MAKEFILE ON)


# 设置 C 编译标记
# 指定C交叉编译器
# set(CMAKE_C_COMPILER “arm-linux-gcc”)
SET (CMAKE_C_COMPILER             "clang")
SET (CMAKE_C_FLAGS "-g -Wall -Werror -O3 -std=c99 -pie -fPIC")
SET (CMAKE_C_FLAGS                "-Wall -std=c99")
SET (CMAKE_C_FLAGS_DEBUG          "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE        "-O4 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")

# 设置 C++ 调试版本标记
SET (CMAKE_CXX_COMPILER             "clang++")
SET (CMAKE_CXX_FLAGS                "-Wall")
SET (CMAKE_CXX_FLAGS_DEBUG          "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
SET (CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET (CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")


SET (CMAKE_AR      "llvm-ar")
SET (CMAKE_LINKER  "llvm-ld")
SET (CMAKE_NM      "llvm-nm")
SET (CMAKE_OBJDUMP "llvm-objdump")
SET (CMAKE_RANLIB  "llvm-ranlib")



# 项目信息
project (Demo3)

# 设置输出目录
# CMAKE_CURRENT_SOURCE_DIR 是源文件路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/output)

# 添加头文件
include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...])

# 源文件集合
file(GLOB SOURCE "../src/*.c" )


# 生成动态库
# add_library(lib_demo cmd.cpp global.cpp md5.cpp)


# 为工程生成目标文件
add_executable(Demo test.c)
# 
# add_executable(libjudger.so ${SOURCE})

# 安装
# 指定目标文件
# 设置目标文件权限
# 设置目标文件存放文职
# install(FILES output/libjudger.so
#        PERMISSIONS OWNER_EXECUTE OWNER_READ    
#        DESTINATION /usr/lib/judger)
